home *** CD-ROM | disk | FTP | other *** search
- Path: news.ox.ac.uk!news
- From: Nick Christie <nick.christie@oucs.ox.ac.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Referances troubble
- Date: 22 Feb 1996 14:42:03 GMT
- Organization: Oxford University Computing Services
- Message-ID: <4ghvbr$qbm@news.ox.ac.uk>
- References: <1266.6624T117T1455@himolde.no>
- NNTP-Posting-Host: nick.oucs.ox.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- Espen.Berntsen@himolde.no wrote:
- >Ok, I have aslight problem with references. The problem is that I have to pass a
- >few pointers to a subroutine, where things are done to them, and then they are
- >passed back. Now, what I hoped would work was something like this
- [snip]
-
- Why not pass a "pointer to a pointer" to the function, which then
- modifies it indirectly:
-
- void main()
- {
- void *ptr;
-
- Test(&ptr);
-
- FreeVec(ptr);
- }
-
- void Test(void **ptrp)
- {
- *ptrp = AllocVec(256,MEMF_ANY);
- }
-
- Nick
- --
- Nick Christie, IT Support, mailto://nick.christie@oucs.ox.ac.uk
- Oxford University Computing Services, http://sable.ox.ac.uk/~nick
- 13 Banbury Road, Oxford OX2 6NN. Opinions expressed are my own.
- "There are no more bugs in my program." -- Anon.
-
-
-